{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import joblib"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 1.加载'../preprocess_data/'中的原始数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "CPU times: user 3min 33s, sys: 17.3 s, total: 3min 50s\n",
      "Wall time: 4min 6s\n"
     ]
    }
   ],
   "source": [
    "%%time\n",
    "input_dir = '../preprocess_data/'\n",
    "train_x = pd.read_csv(input_dir + 'train_x_33465.csv')\n",
    "unlabel_x = pd.read_csv(input_dir + 'unlabel_x_66535.csv')\n",
    "train_ax = pd.concat([train_x,unlabel_x], axis=0, ignore_index=True)\n",
    "\n",
    "valid = pd.read_csv(input_dir + 'valid.csv')\n",
    "test = pd.read_csv(input_dir + 'test.csv')\n",
    "\n",
    "train_y = pd.read_csv(input_dir + 'train_y_33465.csv')\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 2.转化lz4格式存储"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['../preprocess_data_new/train_ax.lz4']"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "output_dir = '../preprocess_data_new/'\n",
    "joblib.dump(train_x,output_dir + 'train_x_33465.lz4', compress='lz4')\n",
    "joblib.dump(unlabel_x,output_dir + 'unlabel_x_66535.lz4', compress='lz4')\n",
    "joblib.dump(train_ax,output_dir + 'train_ax.lz4', compress='lz4')\n",
    "\n",
    "joblib.dump(valid,output_dir + 'valid.lz4', compress='lz4')\n",
    "joblib.dump(test,output_dir + 'test.lz4',compress='lz4')\n",
    "\n",
    "joblib.dump(train_y,output_dir + 'train_y_33465.lz4', compress='lz4')\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
